package com.hrbxlh.action;

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.hrbxlh.util.*;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.io.FileUtils;
import org.apache.http.HttpResponse;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.UnexpectedRollbackException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.hrbxlh.actionImpl.ClassActionImpl;
import com.hrbxlh.actionImpl.CourseActionImpl;
import com.hrbxlh.actionImpl.DepActionImpl;
import com.hrbxlh.actionImpl.DepartMentActionImpl;
import com.hrbxlh.actionImpl.LoginActionImpl;
import com.hrbxlh.actionImpl.MemberActionImpl;
import com.hrbxlh.actionImpl.MyCourseActionImpl;
import com.hrbxlh.actionImpl.ParamActionImpl;
import com.hrbxlh.actionImpl.ProfessionActionImpl;
import com.hrbxlh.actionImpl.RoleActionImpl;

/**
* -------------------------------------------------------
* Copyright (c) 2017, 鑫联华信息科技股份有限公司
* All rights reserved.
* FileName：MemberAction.java
* Description：人员action类
* History：
* Date           Author               Desc
* 2017.3.29		  sy                   建立
* -------------------------------------------------------
*/

@Controller
public class MemberAction {

	@Autowired
	@Qualifier("memberActionImpl")
	private MemberActionImpl memberActionImpl;
	
	@Autowired
	@Qualifier("depActionImpl")
	private DepActionImpl depActionImpl;
	
	@Autowired
	@Qualifier("roleActionImpl")
	private RoleActionImpl roleActionImpl;
	
	@Autowired
	@Qualifier("departMentActionImpl")
	private DepartMentActionImpl departMentActionImpl;
	
	@Autowired
	@Qualifier("professionActionImpl")
	private ProfessionActionImpl professionActionImpl;
	
	@Autowired
	@Qualifier("courseActionImpl")
	private CourseActionImpl courseActionImpl;
	
	@Autowired
	@Qualifier("myCourseActionImpl")
	private MyCourseActionImpl myCourseActionImpl;
	
	@Autowired
	@Qualifier("loginActionImpl")
	private LoginActionImpl loginActionImpl;
	
	@Autowired
	@Qualifier("paramActionImpl")
	private ParamActionImpl paramActionImpl;
	
	@Autowired
	@Qualifier("classActionImpl")
	private ClassActionImpl classActionImpl;
	
	//日志信息
	Logger logger = Logger.getLogger(MemberAction.class.getName());
	

	/**
	 * @param request
	 * @param response
	 * @return  跳转到添加人员页面
	 * @throws IOException
	 */
	@RequestMapping(value = "/skipAddMember", method = RequestMethod.POST)
	public void skipAddMember(String jsonStr,HttpServletRequest request, HttpServletResponse response) throws IOException {

		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		//返回字符串
		String reJsonStr = "";
		//存放页面
		String pageName = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		try {
			//参数
			Map<String, Object> paramMap = new HashMap<String, Object>();
			//获取页面参数值
			Map<String,Object> preParamMap = mapper.readValue(jsonStr, resultMap.getClass());
			//获取全部部门信息
			List<Map<String, Object>> depList = depActionImpl.getDepList(paramMap);
			//获取全部角色信息
			List<Map<String, Object>> roleList = roleActionImpl.getRoleList(preParamMap);
			//获取全部院系
			List<Map<String,Object>> departMentList = departMentActionImpl.getDepartMentList(paramMap);
			//获取全部专业
//			List<Map<String,Object>> professionList = professionActionImpl.getProfessionList(paramMap);
			//查询当前人的消息
			/*List<Map<String, Object>> noticeList = courseActionImpl.getMyNotice(request);
			resultMap.put("noticeList", noticeList);*/
			//返回值
			resultMap.put("depList", depList);
			resultMap.put("roleList", roleList);
			resultMap.put("departMentList", departMentList);
			logger.info("跳转到添加人员页面的参数为:"+jsonStr);
//			resultMap.put("professionList", professionList);
			//添加页面名称
			/*if(String.valueOf(preParamMap.get("pageType")).equals("1")){
				pageName = "pc/addTeacher";
			}else if(String.valueOf(preParamMap.get("pageType")).equals("2")){
				pageName = "pc/addUser";
			}*/

		} catch (Exception e) {
			resultMap.put("errMsg", "跳转页面失败");
			e.printStackTrace();
			logger.error("跳转添加人员页面出现异常", e);
		} finally {
			logger.info("跳转到添加人员页面返回的结果为:"+resultMap);
			PubMethods.postMed(response,mapper,resultMap);
		}
	}

	/**
	 * @param request
	 * @param response
	 * @return  添加人员,传回姓名，性别，电话，登录名，密码，角色id,部门id。
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/addMember", method = RequestMethod.POST)
	public void addMember(String jsonStr, HttpServletRequest request, HttpServletResponse response) throws IOException {		
		
		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//返回字符串
		String reJsonStr = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		//成功失败标识
		String resultMark = "fail";
		try {
			/*模拟参数开始*/
			//Map<String, Object> mapUse = new HashMap<String, Object>();
			//mapUse.put("userSex", "M");
			//mapUse.put("telephoneNum", "15245020967");
			//mapUse.put("userName", "test1");
			//mapUse.put("password", "123456");
			//mapUse.put("loginName", "哈哈");
			//mapUse.put("roleId",1);
			//mapUse.put("depId",1);
			//jsonStr = mapper.writeValueAsString(mapUse);
			/*模拟参数结束*/
			String pwd = "";
			String password = "";
			//获取参数值
			Map<String,Object> paramMap = mapper.readValue(jsonStr, resultMap.getClass());
			if((String)paramMap.get("password")!=null&&(String)paramMap.get("password")!=""){
				//将密码和工号/学号一起用MD5加密
				pwd = (String)paramMap.get("stuorteaId")+(String)paramMap.get("password");
				password = DigestUtils.md5Hex(pwd);
			}else{
				//将密码默认给6个0和工号/学号一起用MD5加密
				pwd = (String)paramMap.get("stuorteaId")+"000000";
				password = DigestUtils.md5Hex(pwd);
			}
			
			paramMap.put("password", password);
			//添加人员
			Map<String, String> resultFlag = memberActionImpl.addMember(paramMap);
			resultMark = (resultFlag.get("result").equals("true")) ? "success" : "fail";
			resultMap.put("result", resultMark);
			if(resultMark.equals("fail")){
				resultMap.put("errorMsg", resultFlag.get("errorMsg"));
			}
			logger.info("添加人员post参数为:"+jsonStr);
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("添加人员post出现异常", e);
		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			logger.info("添加人员post返回的结果为:"+reJsonStr);
			response.setContentType("text/html;charset=UTF-8");
			PrintWriter write = response.getWriter();
			write.println(reJsonStr);
			write.flush();
		}
	}
	


	/**
	 * @param request
	 * @param response
	 * @return  进修改人员页面,需要人员id，传回人员全部信息，角色列表，部门列表。
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/skipSaveMember", method = RequestMethod.POST)
	public void skipSaveMember(String jsonStr, HttpServletRequest request, HttpServletResponse response) throws IOException {

		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		//返回字符串
		String reJsonStr = "";
		//存放页面
		String pageName = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		try {

			//获取页面参数值
			Map<String,Object> preParamMap = mapper.readValue(jsonStr, resultMap.getClass());
			Map<String, Object> MemMap = memberActionImpl.getAdminByStuorteaId(String.valueOf(preParamMap.get("stuorteaId")));
			//参数
			Map<String, Object> paramMap = new HashMap<String, Object>();
			//获取全部部门信息
			List<Map<String, Object>> depList = depActionImpl.getDepList(paramMap);
			//获取全部角色信息
			paramMap.put("pageType",2);
			List<Map<String, Object>> roleList = roleActionImpl.getRoleList(paramMap);
			//获取全部院系
			List<Map<String,Object>> departMentList = departMentActionImpl.getDepartMentList(preParamMap);
			resultMap.put("departMentList", departMentList);
			//查询当前人的消息
			/*List<Map<String, Object>> noticeList = courseActionImpl.getMyNotice(request);
			resultMap.put("noticeList", noticeList);*/
			//返回值
			resultMap.put("depList", depList);
			resultMap.put("roleList", roleList);
			resultMap.put("user", MemMap.get("memberMap"));
			logger.info(" 进修改人员页面的参数为:"+jsonStr);

		} catch (Exception e) {
			resultMap.put("errMsg", "跳转页面失败");
			e.printStackTrace();
			logger.error("跳转修改人员页面出现异常", e);

		} finally {
			logger.info(" 进修改人员页面返回的结果为:"+resultMap);
			PubMethods.postMed(response,mapper,resultMap);
		}

	}
	
	/**
	 * @param request
	 * @param response  
	 * @return  修改人员,传回人员id，姓名，性别，电话，登录名，角色id,部门id，邮箱.
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/saveMember", method = RequestMethod.POST)
	public void saveMember(String jsonStr, HttpServletRequest request, HttpServletResponse response,HttpSession session) throws IOException {		
		
		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//返回字符串
		String reJsonStr = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		//成功失败标识
		String resultMark = "fail";
		String msg = "";
		try {
			/*模拟参数开始*/
			//Map<String, Object> mapUse = new HashMap<String, Object>();
			//mapUse.put("userNum", 1);
			//mapUse.put("userSex", "F");
			//mapUse.put("telephoneNum", "15245020967");
			//mapUse.put("userName", "test1");
			//mapUse.put("loginName", "修改好使么");
			//mapUse.put("roleId", 1);
			//mapUse.put("depId", 1);
			//jsonStr = mapper.writeValueAsString(mapUse);
			/*模拟参数结束*/
			
			//获取参数值
			Map<String,Object> paramMap = mapper.readValue(jsonStr, resultMap.getClass());
            //修改人员
			boolean flag = memberActionImpl.saveMember(paramMap);
			
			resultMark = (flag == true) ? "success" : "fail";
			if(resultMark.equals("fail")){
				msg = "修改人员失败";
			}
			resultMap.put("result", resultMark);
			resultMap.put("msg",msg);

			logger.info(" 修改人员post参数为:"+jsonStr);
		} catch (Exception e) {
			e.printStackTrace();
			resultMap.put("msg","修改人员出现异常");
			logger.error("修改人员出现异常", e);
		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			logger.info(" 修改人员post返回结果为:"+reJsonStr);
			response.setContentType("text/html;charset=UTF-8");
			PrintWriter write = response.getWriter();
			write.println(reJsonStr);
			write.flush();
		}
	}
	
	/**
	 * @param request
	 * @param response
	 * @return  删除人员,传回人员id集合。List<String>形式   jsonStr = ["1","2","3"...]
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/delMembers", method = RequestMethod.POST)
	public void delMembers(String jsonStr,int memType, HttpServletRequest request, HttpServletResponse response) throws IOException {		
		
		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//返回字符串
		String reJsonStr = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();


		//成功失败标识
		String resultMark = "fail";
		//用于转换参数
		List<String> list = new ArrayList<String>();
		Map<String,Object> paramMap = new HashMap<String,Object>();
		try {
			/*模拟参数开始*/
			//List<Integer> listUse = new ArrayList<Integer>();
			//listUse.add(2);
			//listUse.add(3);
			//jsonStr = mapper.writeValueAsString(listUse);
			/*模拟参数结束*/
			
			//获取参数值
			paramMap = mapper.readValue(jsonStr, paramMap.getClass());
			 List<String> paramList = (List<String>) paramMap.get("list");
			 int marks = Integer.valueOf(String.valueOf(paramMap.get("marks")));
			Map<String,Object> returnMap = new HashMap<String,Object>();
            //删除人员
			returnMap= memberActionImpl.delMember(paramList,request,memType,marks);
			resultMark = (((String) returnMap.get("resultFlag")).equals("true")) ? "success" : "fail";
			resultMap.put("result", resultMark);
			resultMap.put("resultMsg", returnMap.get("resultMsg"));
			resultMap.put("paramMap", paramMap);
			logger.info("  删除人员参数为:"+jsonStr+"memType:"+memType);
		} catch (Exception e) {
			e.printStackTrace();
			resultMap.put("resultMsg", "删除人员出现异常");
			logger.error("删除人员出现异常", e);
		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			logger.info("删除人员返回结果为:"+reJsonStr);
			response.setContentType("text/html;charset=UTF-8");
			PrintWriter write = response.getWriter();
			write.println(reJsonStr);
			write.flush();
		}
	}

	/**
	 * description:删除人员,传回人员id集合。List<String>形式   jsonStr = ["1","2","3"...],判断是否有虚机
	 * @param request
	 * @param response
	 * @return
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/isVm", method = RequestMethod.POST)
	public void isVm(String jsonStr, HttpServletRequest request, HttpServletResponse response) throws IOException {

		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//返回字符串
		String reJsonStr = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		int isVmtype=0;
		//成功失败标识
		String resultMark = "fail";
		//用于转换参数
		List<String> list = new ArrayList<String>();
		Map<String,Object> paramMap = new HashMap<String,Object>();
		try {
			//获取参数值
			paramMap = mapper.readValue(jsonStr, paramMap.getClass());
			List<String> paramList = (List<String>) paramMap.get("list");
			int type = Integer.parseInt(String.valueOf(paramMap.get("type")));
			Map<String,Object> returnMap = new HashMap<String,Object>();
			//判断是否有虚机
			returnMap= memberActionImpl.isVm(paramList,type);
			boolean a = Boolean.parseBoolean((String.valueOf(returnMap.get("resultFlag"))));
			if( Boolean.parseBoolean((String.valueOf(returnMap.get("resultFlag"))))==true &&!String.valueOf(returnMap.get("msg")).equals("")&&Integer.parseInt(String.valueOf(returnMap.get("mark")))!=1){
				//说明有虚机，并且没有报错
				resultMark="success";
				isVmtype=1;
			}if( Boolean.parseBoolean((String.valueOf(returnMap.get("resultFlag"))))==false&&String.valueOf(returnMap.get("msg")).equals("")&&Integer.parseInt(String.valueOf(returnMap.get("mark")))!=1){
				//说明没有虚机
				resultMark="success";
				isVmtype=2;
			}if(Integer.parseInt(String.valueOf(returnMap.get("mark")))==1){
				//说明教师有排课信息,不可删除
				resultMark="fail";
				isVmtype=0;
			}
			resultMap.put("result", resultMark);
			resultMap.put("isVmtype", isVmtype);
			resultMap.put("msg", returnMap.get("msg"));
			logger.info("判断删除人员中是否存在虚机参数为:"+jsonStr);
		} catch (Exception e) {
			e.printStackTrace();
			resultMap.put("result", "fail");
			resultMap.put("msg", "判断删除人员中是否存在虚机出现异常");
			logger.error("删除人员出现异常", e);
		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			logger.info("判断删除人员中是否存在虚机返回结果为:"+reJsonStr);
			response.setContentType("text/html;charset=UTF-8");
			PrintWriter write = response.getWriter();
			write.println(reJsonStr);
			write.flush();
		}
	}


	/**
	 * @param jsonStr pageNow,pageSize(一般是10)，页数从1开始，第一页pageNow传1
	 * @return  人员列表页面，传回全部人员信息。进页面，翻页，条件查询都是这个。
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/getMemberList", method = RequestMethod.POST)
	public void getMemberList(String jsonStr, HttpServletRequest request, HttpServletResponse response) throws IOException {

		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		//返回字符串
		String reJsonStr = "";
		//存放页面
		String pageName = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		try {
			//获取页面参数值
			Map<String, Object> preParamMap = mapper.readValue(jsonStr, returnMap.getClass());
			//搜索框对象
			Map<String, Object> SearObjectMap = new HashMap<String,Object>();
			if(preParamMap.get("departmentId")!=null){
				SearObjectMap.put("departmentId", preParamMap.get("departmentId"));
			}if(preParamMap.get("userName")!=null){
				SearObjectMap.put("userName", preParamMap.get("userName"));
			}if(preParamMap.get("depId")!=null){
				SearObjectMap.put("depId", preParamMap.get("depId"));
			}
			logger.info("人员列表页面为:"+preParamMap);
			//获取人员列表信息
			Map<String, Object> resultAllMap = memberActionImpl.getMemberList(preParamMap,request);
			if(String.valueOf(preParamMap.get("roleMark"))!="3"||String.valueOf(preParamMap.get("roleMark"))!="4"){
				//获取全部院系(说明查的是用户管理不需要院系)
				preParamMap.put("departmentId", 0);
				logger.info("获取全部院系(说明查的是用户管理不需要院系)");
				List<Map<String,Object>> departMentList = departMentActionImpl.getDepartMentList(preParamMap);
				resultMap.put("departMentList", departMentList);
			}

			preParamMap.put("depId", "");
			//获取全部部门信息
			List<Map<String, Object>> depAllList = depActionImpl.getDepList(preParamMap);
			//返回值
			resultMap.put("memberList", resultAllMap.get("memberList"));
			resultMap.put("depAllList", depAllList);
			resultMap.put("totalPage", resultAllMap.get("totalPage"));
			resultMap.put("pageNow", resultAllMap.get("pageNow"));
			resultMap.put("pageSize", preParamMap.get("pageSize"));
			resultMap.put("userName", preParamMap.get("userName"));
			resultMap.put("stuorteaId", preParamMap.get("stuorteaId"));
			resultMap.put("SearObjectMap", SearObjectMap);
			resultMap.put("result", "success");
			resultMap.put("failMsg", "");

		} catch (Exception e) {
			resultMap.put("result", "fail");
			resultMap.put("failMsg", "查询人员列表失败");
			e.printStackTrace();
			logger.error("人员列表页面出现异常", e);
		} finally {
			logger.info("人员列表页面翻译结果为："+resultMap);
			PubMethods.postMed(response,mapper,resultMap);
		}
	}
	
	/**
	 * @description 跳转到登录页面
	 * @param
	 * @return  登录页面
	 * @throws IOException
	 */
	@RequestMapping(value = "/", method = RequestMethod.GET)
	public ModelAndView beforeLogin() throws IOException {
		
		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		Map<String, Object> resultMap = new HashMap<String, Object>();
		//返回字符串
		String reJsonStr = "";
		//存放页面
		String pageName = "";
		ObjectMapper mapper = new ObjectMapper();
		try {
			
			pageName = "login";
		} catch (Exception e) {
			resultMap.put("errMsg", "跳转页面失败");
			e.printStackTrace();
			logger.error("跳转登录页面出现异常", e);
			pageName = "error";
		} finally {
			reJsonStr = mapper.writeValueAsString(returnMap);
			logger.info("跳转登陆页返回的结果为："+reJsonStr);
			resultMap.put("result", reJsonStr);
		}
		return new ModelAndView(pageName, resultMap);
	}


	/**
	 * @description 就是跳个页
	 * @param
	 * @return
	 * @throws IOException
	 */
	@RequestMapping(value = "/overdueList", method = RequestMethod.GET)
	public ModelAndView overdueList(HttpSession session) throws IOException {

		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		Map<String, Object> resultMap = new HashMap<String, Object>();
		//返回字符串
		String reJsonStr = "";
		//存放页面
		String pageName = "";
		ObjectMapper mapper = new ObjectMapper();
		Map<String,Object> sessionMap = new HashMap<>();
		try {
			//将用户id，角色id存入session
			sessionMap.put("stuorteaId", "1111");
			sessionMap.put("roleId", 3);
			//查询登陆表中最大主键
			long mainId = loginActionImpl.getMaxPrimId();
			mainId = mainId+1;
			sessionMap.put("mainId", mainId);
			session.setAttribute("userMsg", sessionMap);
			session.setMaxInactiveInterval(3*60*60);
			//将session里面的内容保存在SessonMapUtil类里
			SessonMapUtil sessonMapUtil = new SessonMapUtil();
			sessonMapUtil.setSessionMap(sessionMap);
			pageName = "overdueList";
		} catch (Exception e) {
			resultMap.put("errMsg", "跳转页面失败");
			e.printStackTrace();
			logger.error("跳转过期人员页面出现异常", e);
			pageName = "error";
		} finally {
			reJsonStr = mapper.writeValueAsString(returnMap);
			logger.info("跳转过期人员页返回的结果为："+reJsonStr);
			resultMap.put("result", reJsonStr);
		}
		return new ModelAndView(pageName, resultMap);
	}

	/**
	 * @description 就是跳个页--清理过期列表页
	 * @param
	 * @return
	 * @throws IOException
	 */
	@RequestMapping(value = "/adminCleanList", method = RequestMethod.GET)
	public ModelAndView adminCleanList(HttpSession session) throws IOException {

		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		Map<String, Object> resultMap = new HashMap<String, Object>();
		//返回字符串
		String reJsonStr = "";
		//存放页面
		String pageName = "";
		ObjectMapper mapper = new ObjectMapper();
		Map<String,Object> sessionMap = new HashMap<>();
		try {
			//将用户id，角色id存入session
			sessionMap.put("stuorteaId", "1111");
			sessionMap.put("roleId", 3);
			//查询登陆表中最大主键
			long mainId = loginActionImpl.getMaxPrimId();
			mainId = mainId+1;
			sessionMap.put("mainId", mainId);
			session.setAttribute("userMsg", sessionMap);
			session.setMaxInactiveInterval(3*60*60);
			//将session里面的内容保存在SessonMapUtil类里
			SessonMapUtil sessonMapUtil = new SessonMapUtil();
			sessonMapUtil.setSessionMap(sessionMap);
			pageName = "adminCleanList";
		} catch (Exception e) {
			resultMap.put("errMsg", "跳转页面失败");
			e.printStackTrace();
			logger.error("跳转人员登陆状态页面出现异常", e);
			pageName = "error";
		} finally {
			reJsonStr = mapper.writeValueAsString(returnMap);
			logger.info("跳转人员登陆状态页返回的结果为："+reJsonStr);
			resultMap.put("result", reJsonStr);
		}
		return new ModelAndView(pageName, resultMap);
	}

	/**
	 * @description 就是跳个页
	 * @param
	 * @return
	 * @throws IOException
	 */
	@RequestMapping(value = "/overdueClassEdit", method = RequestMethod.GET)
	public ModelAndView overdueClassEdit(String stuorteaId,String userName,HttpSession session) throws IOException {

		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		Map<String, Object> resultMap = new HashMap<String, Object>();
		//返回字符串
		String reJsonStr = "";
		//存放页面
		String pageName = "";
		ObjectMapper mapper = new ObjectMapper();
		Map<String,Object> sessionMap = new HashMap<>();
		try {
			//将用户id，角色id存入session
			sessionMap.put("stuorteaId", "1111");
			sessionMap.put("roleId", 3);
			//查询登陆表中最大主键
			long mainId = loginActionImpl.getMaxPrimId();
			mainId = mainId+1;
			sessionMap.put("mainId", mainId);
			session.setAttribute("userMsg", sessionMap);
			session.setMaxInactiveInterval(3*60*60);
			//将session里面的内容保存在SessonMapUtil类里
			SessonMapUtil sessonMapUtil = new SessonMapUtil();
			sessonMapUtil.setSessionMap(sessionMap);
			returnMap.put("stuorteaId",stuorteaId);
			returnMap.put("userName",userName);
			pageName = "overdueClassEdit";
		} catch (Exception e) {
			resultMap.put("errMsg", "跳转页面失败");
			e.printStackTrace();
			logger.error("跳转过期页面中的班级页面出现异常", e);
			pageName = "error";
		} finally {
			reJsonStr = mapper.writeValueAsString(returnMap);
			logger.info("跳转过期页面中的班级页面返回的结果为："+reJsonStr);
			resultMap.put("result", reJsonStr);
		}
		return new ModelAndView(pageName, resultMap);
	}

	/**
	 * @param jsonStr pageNow,pageSize(一般是10)，页数从1开始，第一页pageNow传1
	 * @return  过期人员列表页面，传回全部人员信息。进页面，翻页，条件查询都是这个。
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/getOverMemberList", method = RequestMethod.POST)
	public void getOverMemberList(String jsonStr, HttpServletRequest request, HttpServletResponse response) throws IOException {

		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		//返回字符串
		String reJsonStr = "";
		//存放页面
		String pageName = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		try {
			//获取页面参数值
			Map<String, Object> preParamMap = mapper.readValue(jsonStr, returnMap.getClass());
			//搜索框对象
			Map<String, Object> SearObjectMap = new HashMap<String,Object>();
			if(preParamMap.get("departmentId")!=null){
				SearObjectMap.put("departmentId", preParamMap.get("departmentId"));
			}if(preParamMap.get("userName")!=null){
				SearObjectMap.put("userName", preParamMap.get("userName"));
			}if(preParamMap.get("depId")!=null){
				SearObjectMap.put("depId", preParamMap.get("depId"));
			}
			logger.info("人员列表页面为:"+preParamMap);
			//获取人员列表信息
			Map<String, Object> resultAllMap = memberActionImpl.getOverMemberList(preParamMap);
			//获取全部院系(说明查的是用户管理不需要院系)
			preParamMap.put("departmentId", 0);
			List<Map<String,Object>> departMentList = departMentActionImpl.getDepartMentList(preParamMap);
			resultMap.put("departMentList", departMentList);
			//返回值
			resultMap.put("memberList", resultAllMap.get("memberList"));
			resultMap.put("totalPage", resultAllMap.get("totalPage"));
			resultMap.put("pageNow", resultAllMap.get("pageNow"));
			resultMap.put("pageSize", preParamMap.get("pageSize"));
			resultMap.put("userName", preParamMap.get(""));
			resultMap.put("stuorteaId", preParamMap.get("1111"));
			resultMap.put("SearObjectMap", SearObjectMap);
			resultMap.put("result", "success");
			resultMap.put("failMsg", "");

		} catch (Exception e) {
			resultMap.put("result", "fail");
			resultMap.put("failMsg", "查询过期人员列表失败");
			e.printStackTrace();
			logger.error("过期人员列表页面出现异常", e);
		} finally {
			logger.info("过期人员列表页面翻译结果为："+resultMap);
			PubMethods.postMed(response,mapper,resultMap);
		}
	}

	/**xzx
	 * @description 跳转到无权限页面
	 * @throws IOException
	 */
	@RequestMapping(value = "/noPermission", method = RequestMethod.GET)
	public ModelAndView noPermission() {
		return new ModelAndView("noPermission");
	}

	/**xzx
	 * @description 跳转到无权限页面post方式
	 * @throws IOException
	 */
	@RequestMapping(value = "/noPermissionPost", method = RequestMethod.POST)
	public void noPermissionPost(HttpServletResponse  res) {

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("result", "fail");
		map.put("failMsg", "暂无权限");
		try {
			courseActionImpl.responseStream(res, new ObjectMapper().writeValueAsString(map));
		} catch (JsonProcessingException e) {
			e.printStackTrace();
		}
	}
	
	/**
	 * @description 获取验证码
	 * @param request,response
	 * @return  登录页面
	 * @throws IOException
	 */
	@RequestMapping(value = "/captcha", method = RequestMethod.GET)
	public void captcha(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	 	try{
	 		//得到验证码
			AuthImage authImage = new AuthImage();
			authImage.service(request, response);
	 	}catch(Exception e){
	 		logger.error("获取验证码出现异常",e);
	 		e.printStackTrace();
	 	}        
    }
	
	/**
	 * @description 登录提交的action
	 * @param jsonStr :json表单信息 , request,response
	 * @return  成功失败，以及失败信息
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/login", method = RequestMethod.POST)
	public void login(String jsonStr, HttpServletResponse response, HttpServletRequest request, HttpSession session) throws IOException {
		
		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		//返回字符串
		String reJsonStr = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		String resultMark = "fail";
		try {
			/*模拟参数开始*/
			//Map<String, Object> mapUse = new HashMap<String, Object>();
			//mapUse.put("loginName", "123");
			//mapUse.put("password", "123456");
			//mapUse.put("verficateCode", "tku6");
			//mapUse.put("rememberMe", "true");
			//jsonStr = mapper.writeValueAsString(mapUse);
			/*模拟参数结束*/
			
			//获取页面参数值
			Map<String, Object> preParamMap = mapper.readValue(jsonStr, returnMap.getClass());
			//登录验证
			Map<String ,Object> resultFlag = memberActionImpl.login(preParamMap, request, session);
			String[] keysArray = {"project_name","server_address"};
			Map<String, Object> urlmap = ConfigFileUtil.getFileMessage("UtilFile.properties", keysArray);
			//判断文件夹存不存在,不存在就创建
			String path = (String)urlmap.get("server_address")+(String)urlmap.get("project_name")+"upload/images/";
			resultMap.put("url", path);
			//返回成功失败
			resultMark = (String.valueOf(resultFlag.get("result")).equals("true")) ? "success" : "fail";
			resultMap.put("result", resultMark);
			resultMap.put("memberMessage", resultFlag.get("memberMessage"));
			if(resultMark.equals("fail")){
				resultMap.put("errorMsg", resultFlag.get("errorMsg"));
			}
			resultMap.put("ip",resultFlag.get("ip"));
			logger.info("登录提交的action的参数为："+jsonStr);
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("登录出现异常", e);
		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			logger.info("登录提交的action返回的结果为："+reJsonStr);
			response.setContentType("text/html;charset=UTF-8");
			PrintWriter write = response.getWriter();
			write.println(reJsonStr);
			write.flush();
		}
	}
	
	/**
	 * @description 跳转到主页
	 * @param request,response
	 * @return  登录页面
	 * @throws IOException
	 */
	@RequestMapping(value = "/skipMainPage", method = RequestMethod.GET)
	public ModelAndView skipMainPage(HttpServletRequest request, HttpServletResponse response, HttpSession session) throws IOException {		
		
		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		Map<String, Object> resultMap = new HashMap<String, Object>();
		//返回字符串
		String reJsonStr = "";
		//存放页面
		String pageName = "";
		ObjectMapper mapper = new ObjectMapper();
		try {
			//获取当前登陆人的id
			Map<String, Object> sessionMap = new SessionValues().getSessionValues(new String[] {"stuorteaId","realRoleId","userName"}, request, "userMsg");
			int roleId = Integer.parseInt(String.valueOf(sessionMap.get("realRoleId")));
			String stuorteaId = String.valueOf(sessionMap.get("stuorteaId"));
			//给前台返回一个唯一标识
			long nowTime = System.currentTimeMillis();
			String onlySId = stuorteaId+nowTime;
			if(stuorteaId==null||stuorteaId.equals("")){
				pageName = "public/login";
			}else{

				String userName = String.valueOf(sessionMap.get("userName"));
				Map<String,Object> paramMap = paramActionImpl.getParamDetail();
				resultMap.put("onlySId",onlySId);
				//查询当前人的消息
				/*List<Map<String, Object>> noticeList = courseActionImpl.getMyNotice(request);
				resultMap.put("noticeList", noticeList);*/
				resultMap.put("paramMap", paramMap);
				resultMap.put("roleId", roleId);
				resultMap.put("stuorteaId", stuorteaId);
				resultMap.put("userName", userName);
				pageName = "pc/main";
			}
		} catch (Exception e) {
			resultMap.put("errMsg", "跳转页面失败");
			e.printStackTrace();
			logger.error("跳转主页面出现异常", e);
			pageName = "public/pageerror";
		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			returnMap.put("result", reJsonStr);
			logger.info("跳转到主页返回的结果为："+reJsonStr);
		}
		return new ModelAndView(pageName, returnMap);
	}
	
	/**
	 * @description 退出系统
	 * @param request,response
	 * @return  登录页面
	 * @throws IOException
	 */
	@RequestMapping(value = "/logOut", method = RequestMethod.GET)
	public ModelAndView logOut(HttpServletRequest request, HttpServletResponse response,HttpSession session) throws IOException {		
		
		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		Map<String, Object> resultMap = new HashMap<String, Object>();
		//返回字符串
		String reJsonStr = "";
		//存放页面
		String pageName = "";
		ObjectMapper mapper = new ObjectMapper();
		try {
			loginActionImpl.upLogin(session,request);
			pageName = "redirect:/";
		//	pageName = "public/login";
		} catch (Exception e) {
			resultMap.put("errMsg", "跳转页面失败");
			e.printStackTrace();
			logger.error("退出系统出现异常", e);
			pageName = "public/pageerror";
		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			returnMap.put("result", reJsonStr);
			logger.info("退出返回的结果为："+reJsonStr);
		}
		return new ModelAndView(pageName);
	}
	
	/**
	 * @description 忘记密码判断
	 * @param response
	 * @return  是否成功的标识，result true成功，false失败，errorMsg 错误信息
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/forgetPasswordJudge", method = RequestMethod.POST)
	public void forgetPasswordJudge(String jsonStr,HttpServletResponse response) throws IOException {

		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		Map<String, Object> resultMap = new HashMap<String, Object>();
		//返回字符串
		String reJsonStr = "";
		//日志信息
		Logger logger = Logger.getLogger(MemberAction.class.getName());
		ObjectMapper mapper = new ObjectMapper();
		try {
			/*模拟参数开始*/
			//Map<String, Object> mapUse = new HashMap<String, Object>();
			//mapUse.put("loginName", "123");
			//jsonStr = mapper.writeValueAsString(mapUse);
			/*模拟参数结束*/
			
			//获取页面参数值
			Map<String, Object> preParamMap = mapper.readValue(jsonStr, returnMap.getClass());
			Map<String, Object> memberMessage = memberActionImpl.getMemberByLogName((String)preParamMap.get("loginName"));
			if(memberMessage == null || memberMessage.get("loginName") == null){
				resultMap.put("result", "fail");
				resultMap.put("errorMsg", "用户名不存在");
			}else{
				resultMap.put("result", "success");
			}
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("忘记密码判断出现异常", e);
		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			logger.info("返回的：" + reJsonStr);
			response.setContentType("text/html;charset=UTF-8");
			PrintWriter write = response.getWriter();
			write.println(reJsonStr);
			write.flush();
		}
	}
		
	/**
	 * @description 跳转到忘记密码页面
	 * @param request,response
	 * @return  
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/skipForgetPassword", method = RequestMethod.GET)
	public ModelAndView skipForgetPassword(String jsonStr, HttpServletRequest request) throws IOException {

		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		Map<String, Object> resultMap = new HashMap<String, Object>();
		//返回字符串
		String reJsonStr = "";
		//存放页面
		String pageName = "";
		//日志信息
		Logger logger = Logger.getLogger(MemberAction.class.getName());
		ObjectMapper mapper = new ObjectMapper();
		try {
			/*模拟参数开始*/
			//Map<String, Object> mapUse = new HashMap<String, Object>();
			//mapUse.put("loginName", "123");
			//jsonStr = mapper.writeValueAsString(mapUse);
			/*模拟参数结束*/
			
			//获取页面参数值
			Map<String, Object> preParamMap = mapper.readValue(jsonStr, returnMap.getClass());
			resultMap = preParamMap;
			pageName = "pc/forgetPassword";
		} catch (Exception e) {
			resultMap.put("errMsg", "跳转页面失败");
			logger.error("忘记密码判断出现异常", e);
			pageName = "public/pageerror";
		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			returnMap.put("result", reJsonStr);
			logger.info("返回的:"+reJsonStr);
		}
		return new ModelAndView(pageName, returnMap);
	}
		
	/**
	 * 短信验证码
	 * @param jsonStr 电话号
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/getCode", method = RequestMethod.POST)
	public void getCode(String jsonStr, HttpServletResponse response) throws IOException {

		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		//日志信息
		Logger logger = Logger.getLogger(MemberAction.class.getName());
		ObjectMapper mapper = new ObjectMapper();
		try {
			/*模拟参数开始*/
			//Map<String, Object> mapUse = new HashMap<String, Object>();
			//mapUse.put("phoneNum", "15546152160");
			//jsonStr = mapper.writeValueAsString(mapUse);
			/*模拟参数结束*/
			
			//获取页面参数值
			Map<String, Object> preParamMap = mapper.readValue(jsonStr, returnMap.getClass());
			String phoneNum = (String)preParamMap.get("phoneNum");
			//获取验证码
			String code = SendMsgUtil.createRandomVcode();
			//发送短信
			SendMsgUtil.sendMsgYZ(phoneNum, code);
			logger.info("短信验证码："+code);
			PrintWriter write = response.getWriter();
			write.println(code);
			write.flush();
		}catch (Exception e) {
			logger.error("短信验证码出现异常", e);
		}
	}
	
	/**
	 * 20171103 商莹改
	 * @description 修改密码提交
	 * @param  jsonStr 登录ID，密码，（需要页面判断验证码输入是否正确）
	 * @return success成功   fail失败
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/forgetPasswordSubmit", method = RequestMethod.POST)
	public void forgetPasswordSubmit(String jsonStr, HttpServletRequest request, HttpServletResponse response) throws IOException {
		
		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//返回字符串
		String reJsonStr = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		Map<String,Object> returnMap = new HashMap<String,Object>();		
		//成功失败标识
		String resultMark = "fail";
		try {
			/*模拟参数开始*/
			//Map<String, Object> map = new HashMap<String, Object>();
			//map.put("loginName", "哈哈");
			//map.put("password", "000");
			//jsonStr = mapper.writeValueAsString(map);
			/*模拟参数结束*/
			
			//获取参数值
			resultMap = mapper.readValue(jsonStr, resultMap.getClass());

			logger.info("修改密码提交的参数为："+jsonStr);
			//修改密码
			returnMap = memberActionImpl.savePassword(resultMap,request);
			boolean flag = (Boolean)returnMap.get("flag") ;
			resultMark = (flag == true) ? "success" : "fail";
			resultMap.put("result", resultMark);
			resultMap.put("msg", returnMap.get("msg"));
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("修改密码出现异常", e);
		} finally {
			logger.info("修改密码提交返回的结果为："+resultMap);
			PubMethods.postMed(response,mapper,resultMap);
		}
	}
	


	/**用户详情
	 * @param
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/getMemberDetailById", method = RequestMethod.POST)
	public void getMemberDetailById(String jsonStr, HttpServletRequest request, HttpServletResponse response) throws IOException {
		
		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		//返回字符串
		String reJsonStr = "";
		//存放页面
		String pageName = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();

		try {
			logger.info("用户详情的参数为："+jsonStr);
			//获取页面参数值
			Map<String, Object> preParamMap = mapper.readValue(jsonStr, returnMap.getClass());
			Map<String, Object> sessionMap = new SessionValues().getSessionValues(new String[]{"roleId"}, request, "userMsg");
			int roleId = Integer.parseInt(String.valueOf(sessionMap.get("roleId")));
			//获取人员列表信息
			Map<String, Object> resultAllMap = memberActionImpl.getMemberDetailById(preParamMap);
			String[] interfaceNameArrUse = {"server_address","project_name"};
			String[] valueArrUse = PropertiesUtil.getUrl(interfaceNameArrUse);
			String urlUse = "";
			for(String value:valueArrUse){
				urlUse += value;
			}
			//返回图片地址
			String returnUrl= urlUse+"upload/images";
			//返回值
			List<Map<String, Object>> memberList = new ArrayList<Map<String, Object>>();
			if(resultAllMap.get("memberList")!=null){
				memberList = (List<Map<String, Object>>) resultAllMap.get("memberList");
			}
			resultMap.put("memberList",memberList);
			resultMap.put("imageUrl", returnUrl);
			resultMap.put("preParamMap",preParamMap);
			//查询当前人的消息
			List<Map<String, Object>> noticeList = courseActionImpl.getMyNotice(request);
			resultMap.put("noticeList", noticeList);
			if(roleId==2){
				//查当前登陆人的所有课程(未结课的)
				List<Map<String,Object>> courseList = courseActionImpl.getTeaTeachCourseByNoEnd(preParamMap);
				resultMap.put("courseList", courseList);
			}if(roleId==1){
				//查当前登陆人的所有课程(不与试卷关联)
				List<Map<String,Object>> courseList = myCourseActionImpl.getStuListAllCourse(preParamMap);
				resultMap.put("courseList", courseList);
			}

		} catch (Exception e) {
			resultMap.put("errMsg", "跳转页面失败");
			e.printStackTrace();
			logger.error("人员详情页面出现异常", e);

		} finally {
			logger.info("用户详情返回的结果为："+resultMap);
			PubMethods.postMed(response,mapper,resultMap);
		}

	}
	
	/**
	 * 详情页上传照片和简介
	 * 
	 * @param apkFile file
	 * @param response
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/insertImg", method = RequestMethod.POST)
	public ModelAndView insertImg(
			@RequestParam(value = "apkFile") MultipartFile apkFile,
			@RequestParam(value = "content") String content,
			@RequestParam(value = "stuorteaId") String stuorteaId,
			@RequestParam(value = "professionId") String professionId,
			@RequestParam(value = "departmentId") String departmentId,
			String jsonStr,
			HttpServletResponse response, HttpServletRequest request)
			throws Exception {
		ObjectMapper mapper = new ObjectMapper();
		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		//获取角色
		Map<String, Object> sessionMap = new SessionValues().getSessionValues(new String[] {"realRoleId","roleId"}, request, "userMsg");
		int roleId = Integer.parseInt(String.valueOf(sessionMap.get("realRoleId")));
		int selecetRoleId = Integer.parseInt(String.valueOf(sessionMap.get("roleId")));
		String fileName = "";
		if(apkFile!=null){
			fileName = apkFile.getOriginalFilename();
			
		}
		String textArea = "";
		if(jsonStr==null||jsonStr.equals("")){
			textArea = content;
		}else{
			Map<String,Object> paramMap = mapper.readValue(jsonStr, resultMap.getClass());
			textArea = String.valueOf(paramMap.get("textarea"));
		}
		if (textArea== null||textArea.equals("")) {
			textArea = "";
		} else if (content.length() == 0) {
			textArea = "";
		}
		textArea = textArea.replaceAll("\n", "<br>");
		textArea = textArea.replaceAll("\r", "<br>");
		String view = "";
		String reJsonStr = "";
		
		Map<String, Object> map = new HashMap<String, Object>();
		String json1 = "%7B%22pageNow%22:1,%22pageSize%22:10,%22professionId%22:"+professionId+",%22departmentId%22:"+departmentId+",%22roleId%22:"+roleId+",%22selecetRoleId%22:"+selecetRoleId+",%22roleMark%22:2%7D";
//		String json1 = "%7B%22pageNow%22:1,%22pageSize%22:10,%22professionId%22:0,%22departmentId%22:0,%22roleId%22:2,%22selecetRoleId%22:2%7D";
		try {

			String fileName1 = "";
			// 获取上传文件类型的扩展名,先得到.的位置，再截取从.的下一个位置到文件的最后，最后得到扩展名
			String ext = fileName.substring(fileName.lastIndexOf(".") + 1,
					fileName.length());

			// 对扩展名进行小写转换
			ext = ext.toLowerCase();
			if (ext.equals("png")) {
				fileName1 = stuorteaId + "imageUrl." + ext;
			} else {
				fileName1 = stuorteaId + "imageUrl.png";
			}

			map.put("userContect", textArea);
			map.put("stuorteaId", stuorteaId);
			//查询当前人的消息
			List<Map<String, Object>> noticeList = courseActionImpl.getMyNotice(request);
			resultMap.put("noticeList", noticeList);
			if (fileName != "") {
				String path = request.getSession().getServletContext()
						.getRealPath("/images/pc/" + fileName1);// 存放位置
				File destFile = new File(path);
				String file1 = String.valueOf(destFile);
				map.put("imageUrl", fileName1);
				FileUtils.copyInputStreamToFile(apkFile.getInputStream(),destFile);// 复制临时文件到指定目录下
			} else {
				map.put("imageUrl", "");
			}
			 // 往数据库里面插入
			boolean resultFlag = memberActionImpl.updatImOrContent(map);
			if(resultFlag){
				view = "redirect:/getMemberList?jsonStr=" + json1;
			}else{
				resultMap.put("errMsg", "上传照片和简介失败");
				view = "public/pageerror";
			}
			logger.info("详情页上传照片和简介的参数jsonStr为："+jsonStr+"content:"+content+"apkFile:"+apkFile+
					"stuorteaId:"+stuorteaId+"professionId:"+professionId+"departmentId:"+departmentId);
			
		} catch (Exception e) {
			resultMap.put("errMsg", "上传照片和简介失败");
			e.printStackTrace();
			logger.error("详情页上传照片和简介出现异常", e);
			view = "public/pageerror";

		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			returnMap.put("result", reJsonStr);
			logger.info("上传照片和简介返回的结果为:"+reJsonStr);
		}
		return new ModelAndView(view, returnMap);
	}
	
	/**
	 * 教师/学生信息页修改（包含上传图片和修改简介）
	 * 
	 * @param apkFile file
	 * @param response
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/updateInfo", method = RequestMethod.POST)
	public ModelAndView updateInfo(
			@RequestParam(value = "apkFile") MultipartFile apkFile,String content, String sId,
			int professionId,int departmentId,String bdImage,String userName,String userSex,
			String tel,String pwd,String jsonStr,int param,
			HttpServletResponse response, HttpServletRequest request)
			throws Exception {
		ObjectMapper mapper = new ObjectMapper();
		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		Map<String, Object> map = new HashMap<String, Object>();
		
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
	
		//获取参数值
		String textArea = "";
		if(jsonStr==null||jsonStr.equals("")){
			textArea = content;
		}else{
			Map<String,Object> paramMap = mapper.readValue(jsonStr, resultMap.getClass());
			textArea = String.valueOf(paramMap.get("textarea"));
		}
		String fileName = "";
		Map<String, Object> sessionMap = new SessionValues().getSessionValues(new String[] {"stuorteaId","realRoleId"}, request, "userMsg");
		String stuorteaId = String.valueOf(sessionMap.get("realRoleId"));
		int roleId = Integer.parseInt( String.valueOf(sessionMap.get("realRoleId")));
		String json = "%7B%22pageNow%22:0,%22pageSize%22:10,%22stuorteaId%22:%22"+stuorteaId+"%22,%22param%22:2,%22postFlag%22:1,%22roleId%22:%22"+roleId+"%22,%22selecetRoleId%22:2%7D";
		String json1 = "%7B%22pageNow%22:0,%22pageSize%22:10,%22stuorteaId%22:%22"+stuorteaId+"%22,%22param%22:3,%22postFlag%22:1,%22roleId%22:%22"+roleId+"%22,%22selecetRoleId%22:1%7D";
		if(apkFile!=null){
			logger.info(" 教师/学生信息页修改（包含上传图片和修改简介）上传的是本地图片");
			fileName = apkFile.getOriginalFilename();
			
		}if(!bdImage.equals("")&&bdImage!=null){
			logger.info(" 教师/学生信息页修改（包含上传图片和修改简介）上传的是原有图片");
			String arr[] = bdImage.split("/");
			fileName = arr[2];
		}
		if (textArea== null||textArea.equals("")) {
			textArea = "";
		} else if (content.length() == 0) {
			textArea = "";
		}
		textArea = textArea.replaceAll("\n", "<br>");
		textArea = textArea.replaceAll("\r", "<br>");
		String view = "";
		String reJsonStr = "";
		
	try {

			String fileName1 = "";
			// 获取上传文件类型的扩展名,先得到.的位置，再截取从.的下一个位置到文件的最后，最后得到扩展名
			String ext = fileName.substring(fileName.lastIndexOf(".") + 1,fileName.length());
			if(bdImage.equals("")||bdImage==null){
				// 对扩展名进行小写转换
				ext = ext.toLowerCase();
				if (ext.equals("png")) {
					fileName1 = sId + "." + ext;
				} else {
					fileName1 = sId + ".png";
				}
				
				if (fileName != "") {
					String path = request.getSession().getServletContext()
							.getRealPath("/images/pc/" + fileName1);// 存放位置
					File destFile = new File(path);
					String file1 = String.valueOf(destFile);
					map.put("headIcon", fileName1);
					
					FileUtils.copyInputStreamToFile(apkFile.getInputStream(),destFile);// 复制临时文件到指定目录下
					
				} else {
					map.put("headIcon", "");
				}
			}else{
				//说明选择的是项目原有图片
				logger.info(" 教师/学生信息页修改（包含上传图片和修改简介）说明选择的是项目原有图片");
				map.put("headIcon", fileName);
			}

			map.put("userContect", textArea);
			map.put("stuorteaId", sId);
			map.put("userName", userName);
			map.put("userSex", userSex);
			map.put("telephoneNum", tel);
			map.put("departmentId",departmentId);
			map.put("professionId",professionId);
			map.put("password", pwd);
			 // 往数据库里面插入
			boolean resultFlag = memberActionImpl.updateInfo(map);
			if(resultFlag){
				if(param==2){
					//跳到教师页
					view = "redirect:/getMemberDetailById?jsonStr="+json;
				}if(param==3){
					//跳到学生页
					view = "redirect:/getMemberDetailById?jsonStr="+json1;
				}
				
			}else{
				resultMap.put("errMsg", "操作失败");
				view = "public/pageerror";
			}
			
			
		} catch (Exception e) {
			resultMap.put("errMsg", "操作失败");
			e.printStackTrace();
			logger.error("上传头像失败", e);
			view = "public/pageerror";

		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			returnMap.put("result", reJsonStr);
			logger.info(" 教师/学生信息页修改（包含上传图片和修改简介）返回结果为:"+reJsonStr);
		}
		return new ModelAndView(view, returnMap);
	}
	
	/**
	 * @param request
	 * @param response
	 * @return  通过sid查询当前人的角色是否是教师
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/getMemberByStuorteaId", method = RequestMethod.POST)
	public void getMemberByStuorteaId(String jsonStr, HttpServletRequest request, HttpServletResponse response) throws IOException {		
		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//返回字符串
		String reJsonStr = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		//日志信息
		Logger logger = Logger.getLogger(MemberAction.class.getName());
		//成功失败标识
		String resultMark = "fail";
		try {
			//获取参数值
			Map<String,Object> paramMap = mapper.readValue(jsonStr, resultMap.getClass());
			Map<String,Object> returnMap = memberActionImpl.getMemberByStuorteaId(String.valueOf(paramMap.get("stuorteaId")));
			resultMap.put("memberMap", returnMap.get("memberMap"));
			logger.info("返回的map是"+returnMap);
			resultMark = (returnMap.get("resultFlag").equals("success")) ? "success" : "fail";
			resultMap.put("result", resultMark);
			if(resultMark.equals("fail")){
				resultMap.put("errorMsg", "查询失败");
			}
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败人员出现异常", e);
		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			response.setContentType("text/html;charset=UTF-8");
			PrintWriter write = response.getWriter();
			write.println(reJsonStr);
			write.flush();
		}
	}
	
	/**
	 * @description xzx  添加学生
	 * @param request 如果需要带班级id从这里带,给classId已经返回去了，
	 * @param response
	 * @return  跳转到添加学生页面
	 */
	@RequestMapping(value = "/skipAddStu", method = RequestMethod.POST)
	public void skipAddStu(HttpServletRequest request, HttpServletResponse response,String jsonStr)   {
		
		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		try {
			//获取参数值
			Map<String,Object> paramMap = mapper.readValue(jsonStr, resultMap.getClass());
			//全部院系
			List<Map<String, Object>> departmentList = departMentActionImpl.getDepartmentAll(new HashMap<String, Object>());
			paramMap.put("departMentList", departmentList);
			//获取我的消息
			/*List<Map<String, Object>> noticeList  = courseActionImpl.getMyNotice(request);
			paramMap.put("noticeList", noticeList);*/
			resultMap = paramMap;
			logger.info("添加学生的参数为："+jsonStr);
			resultMap.put("result", "success");
		} catch (Exception e) {
			resultMap.put("result", "fail");
			e.printStackTrace();
			logger.error("跳转添加学生页面出现异常", e);
		} finally {
			try {
				courseActionImpl.responseStream(response, mapper.writeValueAsString(resultMap));
			} catch (JsonProcessingException e) {
				e.printStackTrace();
			}
		}
	}
	
	/**xzx
	 * @dscription 添加学生
	 * @param jsonStr  院系，专业，班级，学号，姓名，性别，手机号
	 * @param response
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/addStu", method = RequestMethod.POST)
	public void  addStu (HttpServletResponse response, String jsonStr) {
		
		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();

		try { 
			//获取参数值
			Map<String,Object> paramMap = mapper.readValue(jsonStr, resultMap.getClass());
			if(courseActionImpl.getMapSpecialMark(response, mapper, resultMap, paramMap)) return;
			//添加学生
			Map<String,Object> addMap = memberActionImpl.addStu(paramMap);
			if((Boolean)addMap.get("result")){
				resultMap.put("result", "success");
			}else{
				resultMap.put("result", "fail");
				resultMap.put("failMsg", addMap.get("failMsg"));
			}
			logger.info("添加学生post参数为："+jsonStr);
			courseActionImpl.responseStream(response, mapper.writeValueAsString(resultMap));
		} catch (Exception e) {
			resultMap.put("result", "fail");
			e.printStackTrace();
			logger.error("添加学生出现异常", e);
			try {
				courseActionImpl.responseStream(response, mapper.writeValueAsString(resultMap));
			} catch (JsonProcessingException e1) {
				e1.printStackTrace();
			}
		}
	}
	
	/**
	 * @param request
	 * @param response
	 * @return  重置密码
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/resetPwd", method = RequestMethod.POST)
	public void resetPwd(String jsonStr, HttpServletRequest request, HttpServletResponse response) throws IOException {		
		
		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//返回字符串
		String reJsonStr = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		//成功失败标识
		String resultMark = "fail";
		try {
			//获取参数值
			Map<String,Object> paramMap = mapper.readValue(jsonStr, resultMap.getClass());
			// 重置密码
			Map<String, Object> resultFlag = memberActionImpl.resetPwd(paramMap);
			resultMark = (resultFlag.get("result").equals("true")) ? "success" : "fail";
			resultMap.put("result", resultMark);
			resultMap.put("errorMsg", resultFlag.get("errorMsg"));
			logger.info("重置密码的参数为："+jsonStr);
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("重置密码出现异常", e);
		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			logger.info("重置密码返回的发结果为："+reJsonStr);
			response.setContentType("text/html;charset=UTF-8");
			PrintWriter write = response.getWriter();
			write.println(reJsonStr);
			write.flush();
		}
	}
	


	/**班级下的学生
	 * @param
	 * @return  班级id
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/getMemberByClassId", method = RequestMethod.POST)
	public void getMemberByClassId(String jsonStr, HttpServletRequest request, HttpServletResponse response) throws IOException {
		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		//返回字符串
		String reJsonStr = "";
		//存放页面
		String pageName = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		try {

			//获取页面参数值
			Map<String, Object> preParamMap = mapper.readValue(jsonStr, returnMap.getClass());
			//获取人员列表信息
			Map<String, Object> resultAllMap = memberActionImpl.getMemberByClassId(preParamMap);
			//获取该班级对应的课程以及任课教师信息
			List<Map<String, Object>> courseList = classActionImpl.getCourseByClassId(preParamMap);
			resultMap.put("courseList", courseList);
			//返回值
			resultMap.put("memberList",resultAllMap.get("memberList"));
			resultMap.put("totalPage",resultAllMap.get("totalPage"));
			resultMap.put("pageSize",10);
			resultMap.put("preParamMap",preParamMap);
			//查询当前人的消息
			/*List<Map<String, Object>> noticeList = courseActionImpl.getMyNotice(request);
			resultMap.put("noticeList", noticeList);*/
			logger.info("班级下的学生的参数为："+jsonStr);

		} catch (Exception e) {
			resultMap.put("errMsg", "跳转页面失败");
			e.printStackTrace();
			logger.error("班级下的学生页面出现异常", e);

		} finally {
			logger.info("班级下的学生返回的参数为："+resultMap);
			PubMethods.postMed(response,mapper,resultMap);
		}

	}

	/**
	 * 20171103 商莹
	 * @param request
	 * @param response
	 * @return  修改头像
	 * @throws IOException
	 */
	@RequestMapping(value = "/updateHeadIcon", method = RequestMethod.POST)
	public void updateHeadIcon(
			@RequestParam(value = "apkFile") MultipartFile apkFile,@RequestParam(value = "bdImage",required = false)String bdImage,
			HttpServletResponse response, HttpServletRequest request)
			throws Exception {
		ObjectMapper mapper = new ObjectMapper();
		//存放返回值
		Map<String, Object> returnMap = new HashMap<String, Object>();
		Map<String, Object> map = new HashMap<String, Object>();

		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		String fileName = "";
		//获取当前登陆人的id
		Map<String, Object> sessionMap = new SessionValues().getSessionValues(new String[] {"stuorteaId"}, request, "userMsg");
		String stuorteaId = String.valueOf(sessionMap.get("stuorteaId"));
		if(apkFile!=null){
			fileName = apkFile.getOriginalFilename();
		}if(!bdImage.equals("")&&bdImage!=null){
//			String arr[] = bdImage.split("/");
//			fileName = arr[2];
			fileName = bdImage;
		}

		logger.info("修改头像的参数apkFile为："+apkFile+"bdImage:"+bdImage);

		String view = "";
		String reJsonStr = "";
		try {
			String[] keysArray = {"tomcatUrl", "project_name","server_address"};
			Map<String, Object> urlmap = ConfigFileUtil.getFileMessage("UtilFile.properties", keysArray);
			String fileName1 = "";
			// 获取上传文件类型的扩展名,先得到.的位置，再截取从.的下一个位置到文件的最后，最后得到扩展名
			String ext = fileName.substring(fileName.lastIndexOf(".") + 1,fileName.length());
			if(bdImage.equals("")||bdImage==null){
				// 对扩展名进行小写转换
				ext = ext.toLowerCase();
				if(!ext.equals("")&&ext!=null){
					if(!ext.equals("png")&&!ext.equals("jpg")&&!ext.equals("jpeg")){
						resultMap.put("resultFlag",false);
						resultMap.put("msg","图片格式不正确");
						return;
					}
				}
				if (ext.equals("png")&&!ext.equals("")&&ext!=null) {
					fileName1 = stuorteaId +fileName+ "." + ext;
				} if(!ext.equals("png")&&!ext.equals("")&&ext!=null) {
					fileName1 = stuorteaId +fileName+ ".png";
				}

				if (fileName != "") {
					//判断文件夹存不存在,不存在就创建
					String path = (String)urlmap.get("tomcatUrl")+(String)urlmap.get("project_name")+"upload/images"+"/"+fileName1;
					File saveFile = new File(path);
					if (!saveFile.exists()) {
						String s = path.substring(0,path.lastIndexOf("/") + 1);
						File saveFileDir = new File(s);
						saveFileDir.mkdirs();
//						saveFile = new File(path);
					}
					File destFile = new File(path);
					String file1 = String.valueOf(destFile);
					map.put("headIcon", fileName1);
					FileUtils.copyInputStreamToFile(apkFile.getInputStream(),destFile);// 复制临时文件到指定目录下
				} else {
					map.put("headIcon", "");
				}
			}else{
				//说明选择的是项目原有图片
				map.put("headIcon", fileName);
			}
			map.put("stuorteaId", stuorteaId);
			// 往数据库里面插入
			Map<String,Object> memMap = memberActionImpl.updateHeadIcon(map);
			boolean resultFlag = (Boolean) memMap.get("flag");
			String msg = resultFlag==true?"上传头像成功":"上传头像失败";
			resultMap.put("resultFlag",resultFlag);
			resultMap.put("msg",msg);
			String headUrl = (String)urlmap.get("server_address")+(String)urlmap.get("project_name")+"upload/images"+"/"+String.valueOf(memMap.get("headIcon"));
			resultMap.put("headUrl",headUrl);
			logger.info("修改头像返回的结果"+resultMap);

		} catch (Exception e) {
			resultMap.put("msg", "操作失败");
			e.printStackTrace();
			logger.error("上传头像失败", e);

		} finally {
			logger.info("修改头像返回的结果为："+resultMap);
			PubMethods.postMed(response,mapper,resultMap);
		}

	}

	/**
	 * @param request
	 * @param response
	 * @return  我的信息表单提交
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/saveMyInfo", method = RequestMethod.POST)
	public void saveMyInfo(String jsonStr, HttpServletRequest request, HttpServletResponse response,HttpSession session) throws IOException {

		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//返回字符串
		String reJsonStr = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		//成功失败标识
		String resultMark = "fail";
		String view = "";
		try {
			//获取当前登陆人的id
			Map<String, Object> sessionMap = new SessionValues().getSessionValues(new String[] {"stuorteaId","realRoleId"}, request, "userMsg");
			String stuorteaId = String.valueOf(sessionMap.get("stuorteaId"));
			//获取参数值
			Map<String,Object> paramMap = mapper.readValue(jsonStr, resultMap.getClass());
			paramMap.put("stuorteaId",stuorteaId);
			//修改人员
			Map<String,Object> infoMap =  memberActionImpl.saveMyInfo(paramMap);
			boolean flag =(Boolean)infoMap.get("resultFlag");
			resultMap.put("flag",flag);
			resultMap.put("msg",infoMap.get("msg"));
			logger.info("我的信息post参数为:"+jsonStr);

			resultMap.put("result",flag);
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("我的信息出现异常", e);
		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			logger.info(" 我的信息post返回结果为:"+reJsonStr);
			response.setContentType("text/html;charset=UTF-8");
			PrintWriter write = response.getWriter();
			write.println(reJsonStr);
			write.flush();
		}
	}

	/**xzx
	 * @description 获取教师或学生信息的方法(管理员修改教师或学生信息用)
	 * @param  jsonStr 人员id
	 * */
	@RequestMapping(value = "/getMemberMsg", method = RequestMethod.POST)
	public void getMemberMsg( HttpServletResponse response,String jsonStr)   {
		memberActionImpl.getMemberMsg(jsonStr, response);
	}

	/**xzx
	 * @description 修改人员信息的方法(管理员修改教师或学生信息用)
	 * */
	@RequestMapping(value = "/saveMemberMsg", method = RequestMethod.POST)
	public void saveMemberMsg( HttpServletResponse response,String jsonStr)   {
		memberActionImpl.saveMemberMsg(jsonStr, response);
	}
	/**
	 * @description 控制是否可以登录系统
	 * @param request,response,截止时间
	 * @return  登录页面
	 * @throws IOException
	 */
	@RequestMapping(value = "/loginYesOrNo", method = RequestMethod.GET)
	public void loginYesOrNo(String time,HttpServletRequest request, HttpServletResponse response,HttpSession session) throws IOException {
		//存放返回值
		try {
			//将传过来的时间放到数据库中
			memberActionImpl.updateSetTime(time);
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("退出系统出现异常", e);

		} finally {
			logger.info("退出返回的结果为：");
		}
	}

	/**
	 * @param
	 * @param
	 * @return  黑名单列表。
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/blackList", method = RequestMethod.POST)
	public void blackList(String jsonStr, HttpServletRequest request, HttpServletResponse response,HttpSession session) throws IOException {

		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//返回字符串
		String reJsonStr = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		Map<String,Object> paramMap = new HashMap<>();
		try {
			logger.info("黑名单列表参数为："+jsonStr);
			//获取参数值
			paramMap = mapper.readValue(jsonStr, resultMap.getClass());
			//黑名单列表。
			resultMap = memberActionImpl.blackList(paramMap);
			resultMap.put("result", "success");
		} catch (Exception e) {
			e.printStackTrace();
			resultMap.put("result", "fail");
			resultMap.put("errorMsg", "黑名单列表出现异常");
			logger.error("黑名单列表出现异常", e);
		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			logger.info("黑名单列表返回结果为："+resultMap);
			response.setContentType("text/html;charset=UTF-8");
			PrintWriter write = response.getWriter();
			write.println(reJsonStr);
			write.flush();
		}
	}


	/**
	 * @param request
	 * @param response
	 * @return  20181113 添加人员并设置过期时间
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/addMemberExpiryTime", method = RequestMethod.POST)
	public void addMemberExpiryTime(String jsonStr, HttpServletRequest request, HttpServletResponse response) throws IOException {

		//转换json格式工具
		ObjectMapper mapper = new ObjectMapper();
		//返回字符串
		String reJsonStr = "";
		//存放结果值
		Map<String,Object> resultMap = new HashMap<String,Object>();
		//成功失败标识
		String resultMark = "fail";
		try {
			//获取参数值
			Map<String,Object> paramMap = mapper.readValue(jsonStr, resultMap.getClass());
			//添加人员
			Map<String, String> resultFlag = memberActionImpl.addMemberExpiryTime(paramMap);
			resultMark = (resultFlag.get("result").equals("true")) ? "success" : "fail";
			resultMap.put("result", resultMark);
			if(resultMark.equals("fail")){
				resultMap.put("errorMsg", resultFlag.get("errorMsg"));
			}
			logger.info("添加人员post参数为:"+jsonStr);
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("添加人员post出现异常", e);
		} finally {
			reJsonStr = mapper.writeValueAsString(resultMap);
			logger.info("添加人员post返回的结果为:"+reJsonStr);
			response.setContentType("text/html;charset=UTF-8");
			PrintWriter write = response.getWriter();
			write.println(reJsonStr);
			write.flush();
		}
	}

	/**
	 * @param request
	 * @param response
	 * @return  20181113 查询过期时间的人员，若过期则删除及删除其关联关系
	 * @throws IOException
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/deleteMemberExpiryTime", method = RequestMethod.POST)
	public void deleteMemberExpiryTime() throws IOException {
		try {
			 memberActionImpl.deleteMemberExpiryTime();
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("定时删除过期人员出现异常", e);
		}
	}

}